/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2022-11-29
 * Time: 16:34
 */
public class Test {

    public static int recursion(int num){
        if (num < 1)
            return 0;
        return recursion(num - 1) + num;
    }

    public static void main(String[] args) {
        int ans = recursion(3);
        System.out.println(ans);
    }
}
